<%@ page contentType="text/html;charset=UTF-8" language="java"
pageEncoding="utf-8"
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>尚硅谷会员登录页面</title>
    <!--写base标签，永远固定相对路径跳转的结果-->
<%--    <base href="http://localhost:8080/book/">--%>

<%--<link type="text/css" rel="stylesheet" href="static/css/style.css" >--%>
    <%@include file="/pages/common/head.jsp"%><%--静态引用,包括项目起始点,和css,jquery等头部信息 --%>
</head>
<body>
        <div id="login_header">
            <img class="logo_img" alt="" src="../../static/img/logo.gif" ><%--这个位置是相对于login.jsp的--%>
        </div>

            <div class="login_banner">

                <div id="l_content">
                    <span class="login_word">欢迎登录</span>
                </div>

                <div id="content">
                    <div class="login_form">
                        <div class="login_box">
                            <div class="tit">
                                <h1>尚硅谷会员</h1>
                                <a href="<%=basepath+"pages/user/regist.jsp"%>">立即注册</a>
                            </div>
                            <div class="msg_cont">
                                <b></b>
                                <span class="errorMsg">
<%--                                    <%=request.getAttribute("msg")==null?"请输入用户名和密码":request.getAttribute("msg")%>--%>
                                    ${empty requestScope.msg?"请输入用户名和密码":requestScope.msg}<%--用el表达式替换jsp表达式,短一点--%>
                                </span>
                            </div>
                            <%
                                if(request.getAttribute("msg")!=null){
                            %>
                                <script>
                                    alert(<%=request.getAttribute("msg")%>)
                                </script>
                            <%
                                }
                            %>
                            <div class="form">
<%--                            <form action=<%=basepath+"loginServlet"%> method="post">--%>
                                <form action=<%=basepath+"userServlet"%> method="post">
                                    <input type="hidden" name="action" value="login">
                                    <label>用户名称：</label>
                                    <input  class="itxt" type="text" placeholder="请输入用户名"
                                           autocomplete="off" tabindex="1" name="username"
<%--                                           value="<%=request.getAttribute("username")==null?"":request.getAttribute("username")%>"--%>
                                           value="${requestScope.username}" <%--el表达式默认返回就是空字符串,所以,不需要判断是否有值,然后负空.它自己就会把null写成空--%>
                                    />
                                    <br />
                                    <br />
                                    <label>用户密码：</label>
                                    <input class="itxt" type="password" placeholder="请输入密码"
                                           autocomplete="off" tabindex="1" name="password"
<%--                                           value="<%=request.getAttribute("password")==null?"":request.getAttribute("password")%>"--%>
                                           value="${requestScope.password}" <%--el表达式默认返回就是空字符串,所以,不需要判断是否有值,然后负空.它自己就会把null写成空--%>
                                    />
                                    <br />
                                    <br />
                                    <input type="submit" value="登录" id="sub_btn" />
                                </form>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
<%--        <div id="bottom">--%>
<%--            <span>--%>
<%--                尚硅谷书城.Copyright &copy;2015--%>
<%--            </span>--%>
<%--        </div>--%>
        <%@include file="/pages/common/foot.jsp"%><%--静态引用,公共底部--%>
</body>
</html>